{% extends "layout.html" %}

{% block content %}
    <div class="container">
        <div style="margin-bottom: 10px">
            <a class="btn btn-success" href="/city/add"><!--若要新建页面打开加 target="_blank"-->
                <span class="glyphicon glyphicon-plus-sign" aria-hidden="true"></span>
                添加城市
            </a>

        </div>
        <div class="panel panel-default">

            <div class="panel-heading">
                <h3 class="panel-title">{{ title }}</h3>
            </div>
            <table class="table table-bordered">
                <thead>
                <tr>
                    <th>ID</th>
                    <th>名称</th>
                    <th>人口</th>
                    <th>Logo</th>
                </tr>
                </thead>
                <tbody>
                {% for obj in queryset %}
                    <tr>
                        <th scope="row">{{ obj.id }}</th>
                        <td>{{ obj.name }}</td>
                        <td>{{ obj.people }}</td>

                        <td>
                            <img src="/media/{{ obj.img }}" style="height: 80px">
                        </td>
                        <td>
                            <a class="btn btn-primary btn-xs" href="/city/{{ obj.id }}/edit/">编辑</a>
                            <a class="btn btn-danger btn-xs" href="/city/{{ obj.id }}/delete/">删除</a>
                        </td>
                    </tr>
                {% endfor %}


                </tbody>
            </table>
        </div>
        <nav aria-label="Page navigation">
            <ul class="pagination">
                {{ page_string }}
            </ul>
        </nav>
    </div>
{% endblock %}